package cn.buddha.jesj.list;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @ClassName Human
 * @Author 友野浩二
 * @Date 2019/12/10 10:13
 * @Description 人类
 * @Version 1.0
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class Human implements Comparable<Human> {

    private String vocation;// 职业
    private String city;// 城市
    private String grades;// 等级: 1-上等人;2-中等人;3-下等人

    @Override
    public int compareTo(Human human) {
        // 升序排序
        return this.getGrades().compareTo(human.getGrades());
    }

    @Override
    public String toString() {
        return "{vocation: " + vocation + ", city: " + city + ", grades: " + grades + "}";
    }
}
